<!DOCTYPE HTML>
<html lang="zh-CN">


<head><meta name="generator" content="Hexo 3.8.0">
    <meta charset="utf-8">
    <meta name="keywords" content="搭桥, Five-great的博客">
    <meta name="description" content="题目：搭桥题目链接：http://codevs.cn/problem/1002/题目描述 Description有一矩形区域的城市中建筑了若干建筑物，如果某两个单元格有一个点相联系，则它们属于同一座建筑物。现在想在这些建筑物之间搭建一些桥梁">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <title>搭桥 | Five-great的博客</title>
    <link rel="icon" type="image/png" href="/favicon.png">

    <link rel="stylesheet" type="text/css" href="/libs/awesome/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">
    <style type="text/css">
        
    </style>
	<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?d62256055258ddb12716821c285aadab";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>


    <script src="/libs/jquery/jquery-2.2.0.min.js"></script>
<link rel="stylesheet" href="/css/prism-tomorrow.css" type="text/css"></head>


<body>


<script type="text/javascript">
$(document).ready(function(){
  if(window.outerHeight <500&&window.outerWidth<400){
  $("#p1").hide();
  $("#p2").show();
   }else{
  $("#p1").show();
  $("#p2").hide(); 
  }
});
</script>
<header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a id="p1" href="/" class="waves-effect waves-light">
                    
                    <img src="/medias/logo-loading1.png" data-original="/medias/logo.png" class="logo-img" alt="LOGO">
                    
                     <span class="logo-span">Five-great的博客</span>
                </a>
				<a id="p2" href="/" class="waves-effect waves-light">
                     <span class="logo-span"><font size="4">Five-great的博客</font></span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fa fa-navicon"></i></a>
<ul class="right">
    
    <li class="hide-on-med-and-down">
        <a href="/" class="waves-effect waves-light">
            
            <i class="fa fa-home"></i>
            
            <span>首页</span>
        </a>
    </li>
    
    <li class="hide-on-med-and-down">
        <a href="/tags" class="waves-effect waves-light">
            
            <i class="fa fa-tags"></i>
            
            <span>标签</span>
        </a>
    </li>
    
    <li class="hide-on-med-and-down">
        <a href="/categories" class="waves-effect waves-light">
            
            <i class="fa fa-bookmark"></i>
            
            <span>分类</span>
        </a>
    </li>
    
    <li class="hide-on-med-and-down">
        <a href="/archives" class="waves-effect waves-light">
            
            <i class="fa fa-archive"></i>
            
            <span>归档</span>
        </a>
    </li>
    
    <li class="hide-on-med-and-down">
        <a href="/about" class="waves-effect waves-light">
            
            <i class="fa fa-user-circle-o"></i>
            
            <span>关于</span>
        </a>
    </li>
    
    <li class="hide-on-med-and-down">
        <a href="/friends" class="waves-effect waves-light">
            
            <i class="fa fa-address-book"></i>
            
            <span>友情链接</span>
        </a>
    </li>
    
    <li>
        <a href="#searchModal" class="modal-trigger waves-effect waves-light">
            <i id="searchIcon" class="fa fa-search" title="搜索"></i>
        </a>
    </li>
</ul>

<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
		<img src="/medias/logo-loading1.png" data-original="/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">Five-great的博客</div>
        <div class="logo-desc">
            
            有事多研究 没事多琢磨
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li>
            <a href="/" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-home"></i>
                
                首页
            </a>
        </li>
        
        <li>
            <a href="/tags" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-tags"></i>
                
                标签
            </a>
        </li>
        
        <li>
            <a href="/categories" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-bookmark"></i>
                
                分类
            </a>
        </li>
        
        <li>
            <a href="/archives" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-archive"></i>
                
                归档
            </a>
        </li>
        
        <li>
            <a href="/about" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-user-circle-o"></i>
                
                关于
            </a>
        </li>
        
        <li>
            <a href="/friends" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-address-book"></i>
                
                友情链接
            </a>
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="https://github.com/blinkfox/hexo-theme-matery" class="waves-effect waves-light" target="_blank">
                <i class="fa fa-github-square fa-fw"></i>Fork Me
            </a>
        </li>
        
    </ul>
</div>

        </div>

        
            <style>
    .nav-transparent .github-corner {
        display: none !important;
    }

    .github-corner {
        position: absolute;
        z-index: 10;
        top: 0;
        right: 0;
        border: 0;
        transform: scale(1.1);
    }

    .github-corner svg {
        color: #0f9d58;
        fill: #fff;
        height: 64px;
        width: 64px;
    }

    .github-corner:hover .octo-arm {
        animation: a 0.56s ease-in-out;
    }

    .github-corner .octo-arm {
        animation: none;
    }

    @keyframes a {
        0%,
        to {
            transform: rotate(0);
        }
        20%,
        60% {
            transform: rotate(-25deg);
        }
        40%,
        80% {
            transform: rotate(10deg);
        }
    }
</style>

<a href="https://github.com/blinkfox/hexo-theme-matery" class="github-corner tooltipped hide-on-med-and-down" target="_blank" data-tooltip="Fork Me" data-position="left" data-delay="50">
    <svg viewbox="0 0 250 250" aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"/>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"/>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"/>
    </svg>
</a>
        
    </nav>
 


</header>

<style>
		#canvas1 {
 position: fixed;
 pointer-events:none;//鼠标多层响应事件
        // background: 	#ccc;
		 /*透明度*/
		 width: 100%;
        height: 100%;
     // opacity: 0;
		 overflow: auto;
		 z-index: 999;

    }
</style>
<body>
<canvas id="canvas1" style="whdth: 100%;height: 100%"></canvas>

<script>
var _createClass = function () {function defineProperties(target, props) 
{ for (var i = 0; i < props.length; i++) 
 {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) 
 descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}
 return function (Constructor, protoProps, staticProps) 
 {if (protoProps) defineProperties(Constructor.prototype, protoProps);
 if (staticProps) defineProperties(Constructor, staticProps);
 return Constructor;};}();function _classCallCheck(instance, Constructor) 
 {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}
 var getRandom = function getRandom(min, max) {
  return Math.random() * (max - min) + min;
};

var getRandomInt = function getRandomInt(min, max) {
  return Math.floor(Math.random() * (max - min)) + min;
};

var getRandomColor = function getRandomColor() {
  var colors = [
  'rgba(231, 76, 60, 1)', // red
  'rgba(241, 196, 15, 1)', // yellow
  'rgba(46, 204, 113, 1)', // green
  'rgba(52, 152, 219, 1)', // blue
  'rgba(155, 89, 182, 1)' // purple
  ];

  return colors[getRandomInt(0, colors.length)];
};

// Particle//粒子模块
var
Particle = function () {

  function Particle(system, x, y) {_classCallCheck(this, Particle);
    this.system = system;
    this.universe = this.system.world.universe;
    this.x = x;
    this.y = y;
    this.color = getRandomColor();
    this.life = 1;
    this.aging = getRandom(0.990, 0.999); // 0.99, 0.999 || 0.999, 0.9999

    this.r = getRandomInt(12, 16);//初始粒子半径范围
    this.speed = getRandom(18, 18.5);//粒子爆炸速度范围
    this.velocity = [
    getRandom(-this.speed, this.speed),
    getRandom(-this.speed, this.speed)];

  }_createClass(Particle, [{ key: 'update', value: function update(

    dt) {
      this.life *= this.aging;

      if (
      this.r < 0.1 ||
      this.life === 0 ||
      this.x + this.r < 0 ||
      this.x - this.r > this.universe.width ||
      this.y + this.r < 0 ||
      this.y - this.r > this.universe.height)
      {
        this.system.removeObject(this);
      }

      this.r *= this.life;
      this.x += this.velocity[0];
      this.y += this.velocity[1];
    } }, { key: 'render', value: function render(

    ctx) {
      // Main circle //亮圈模块

      ctx.fillStyle = this.color;
      ctx.beginPath();
      ctx.arc(this.x, this.y, this.r*1.2, 0, 2 * Math.PI, false);
      ctx.fill();
      ctx.closePath();

      var r = this.color.match(/([0-9]+)/g)[0];
      var g = this.color.match(/([0-9]+)/g)[1];
      var b = this.color.match(/([0-9]+)/g)[2];

      // Gradient//梯度变化曲线

      var spread = 1.5;
      var gradient = ctx.createRadialGradient(
      this.x, this.y, this.r,
      this.x, this.y, this.r * spread);

      gradient.addColorStop(0, 'rgba(' + r + ', ' + g + ', ' + b + ', 0.5)');
      gradient.addColorStop(1, 'rgba(' + r + ', ' + g + ', ' + b + ', 0)');

      ctx.globalCompositeOperation = 'lighter';
      ctx.fillStyle = gradient;
      ctx.beginPath();
      ctx.arc(this.x, this.y, this.r * spread, 0, 2 * Math.PI, false);
      ctx.fill();
      ctx.closePath();
      ctx.globalCompositeOperation = 'source-over';

      // Aberration//偏差

      var offset = this.r * 0.5;
      var color = 'rgba(' + g + ', ' + b + ', ' + r + ', 0.5)';

      ctx.globalCompositeOperation = 'lighter';
      ctx.fillStyle = color;
      ctx.beginPath();
      ctx.arc(this.x + offset, this.y + offset, this.r, 0, 2 * Math.PI, false);
      ctx.fill();
      ctx.closePath();
      ctx.globalCompositeOperation = 'source-over';
    } }]);return Particle;}();



// Crown //水波纹圈模块
var
Crown = function () {

  function Crown(system, x, y) {_classCallCheck(this, Crown);
    this.system = system;
    this.x = x;
    this.y = y;
    this.r = getRandomInt(5, 15); // 5, 20  水波纹圈半径范围
    this.mod = 1.1;
    this.life = 0.5; //水波纹线
    this.aging = getRandom(0.830, 0.899);
    this.speed = getRandom(8, 9);
    this.color = {
      r: getRandomInt(236, 242),
      g: getRandomInt(70, 80),
      b: getRandomInt(50, 70) };


    this.angle1 = Math.PI * getRandom(0, 2);
    this.angle2 = this.angle1 + Math.PI * getRandom(0.3, 0.4);//水波纹圈完整度
  }_createClass(Crown, [{ key: 'update', value: function update(

    dt) {
      this.life *= this.aging;

      if (this.life <= 0.0001) this.system.removeObject(this);

      this.r += Math.abs(1 - this.life) * this.speed;

      this.x1 = this.x + this.r * Math.cos(this.angle1);
      this.y1 = this.y + this.r * Math.sin(this.angle1);

      this.angle3 = this.angle1 + (this.angle2 - this.angle1) / 2;
      this.x2 = this.x + this.r * this.mod * Math.cos(this.angle3);
      this.y2 = this.y + this.r * this.mod * Math.sin(this.angle3);
    } }, { key: 'render', value: function render(

    ctx) {
      var gradient = ctx.createRadialGradient(
      this.x, this.y, this.r * 0.9,
      this.x, this.y, this.r);

      gradient.addColorStop(0, 'rgba(' + this.color.r + ', ' + this.color.g + ', ' + this.color.b + ', ' + this.life + ')');
      gradient.addColorStop(1, 'rgba(' + this.color.r + ', ' + this.color.g + ', ' + this.color.b + ', ' + this.life * 0.5 + ')');

      ctx.fillStyle = gradient;
      ctx.beginPath();
      ctx.arc(this.x, this.y, this.r, this.angle1, this.angle2, false);
      ctx.quadraticCurveTo(this.x2, this.y2, this.x1, this.y1);
      ctx.fill();
      ctx.closePath();
    } }]);return Crown;}();



// Explosion //爆炸模块
var
Explosion = function () {

  function Explosion(world, x, y) {_classCallCheck(this, Explosion);
    this.world = world;
    this.x = x;
    this.y = y;
    this.objects = [];

    var particles = getRandomInt(10, 30); // 10, 30 amount of particles//爆炸 粒子数量
    var crowns = particles * getRandom(0.4, 0.5);

    while (crowns-- > 0) {this.addCrown();}
    while (particles-- > 0) {this.addParticle();}
  }_createClass(Explosion, [{ key: 'update', value: function update(

    dt) {
      this.objects.forEach(function (obj) {
        if (obj) obj.update(dt);
      });

      if (this.objects.length <= 0) {
        this.world.clearExplosion(this);
      }
    } }, { key: 'render', value: function render(

    ctx) {
      this.objects.forEach(function (obj) {
        if (obj) obj.render(ctx);
      });
    } }, { key: 'addCrown', value: function addCrown()

    {
      this.objects.push(new Crown(this, this.x, this.y));
    } }, { key: 'addParticle', value: function addParticle()

    {
      this.objects.push(new Particle(this, this.x, this.y));
    } }, { key: 'removeObject', value: function removeObject(

    obj) {
      var index = this.objects.indexOf(obj);

      if (index !== -1) {
        this.objects.splice(index, 1);
      }
    } }]);return Explosion;}();



// World 
var
ConfettiWorld = function () {function ConfettiWorld() 
{_classCallCheck(this, ConfettiWorld);}_createClass(ConfettiWorld, [{ key: 'init', value: function init()

    {
      this.objects = [];
      window.addEventListener('click', this.explode.bind(this));

      // Initial explosion //初始爆炸
      var counter = 0;
      while (counter-- > 0) {
        this.explode({
          clientX: window.event.clientX, //getRandomInt(10, this.universe.width) ,          //this.universe.width / 2,
          clientY: window.event.clientY //getRandomInt(10, 50) //this.universe.height / 2 
		  });

      }
    } }, { key: 'update', value: function update(

    dt) {
      this.objects.forEach(function (obj) {
        if (obj) obj.update(dt);
      });

      var amount = this.objects.reduce(function (sum, explosion) {
        return sum += explosion.objects.length;
      }, 0);
    } }, { key: 'render', value: function render(

    ctx) {
      this.objects.forEach(function (obj) {
        if (obj) obj.render(ctx);
      });
    } }, { key: 'explode', value: function explode(

    event) {
      var x = event.clientX;
      var y = event.clientY;

      this.objects.push(new Explosion(this, x, y));
    } }, { key: 'clearExplosion', value: function clearExplosion(

    explosion) {
      var index = this.objects.indexOf(explosion);

      if (index !== -1) {
        this.objects.splice(index, 1);
      }
    } }]);return ConfettiWorld;}();



// Time
var
Time = function () {

  function Time() {_classCallCheck(this, Time);
    this.now = 0; // current tick time
    this.prev = 0; // prev tick time
    this.elapsed = 0; // elapsed time from last tick
    this.delta = 0; // time from last update
    this.fps = 60; // desired fps
    this.step = 1 / 60; // step duration
  }_createClass(Time, [{ key: 'update', value: function update(

    time) {
      this.now = time;
      this.elapsed = (this.now - this.prev) / 1000;
      this.prev = this.now;
      this.delta += this.elapsed;
    } }, { key: 'raf', value: function raf(

    func) {
      window.requestAnimationFrame(func);
    } }, { key: 'hasFrames', value: function hasFrames()

    {
      return this.delta >= this.step;
    } }, { key: 'processFrame', value: function processFrame()

    {
      this.delta -= this.step;
    } }]);return Time;}();



// Canvas
var
Universe = function () {

  function Universe(element) {_classCallCheck(this, Universe);
    this.el = element;
    this.ctx = this.el.getContext('2d');
    this.pixelRatio = window.devicePixelRatio;
    this.time = new Time();

    this.worlds = {};
    this.world = null; // current state

    this.updateSize();
    window.addEventListener('resize', this.updateSize.bind(this));

    this.addWorld('confetti', ConfettiWorld);
    this.setWorld('confetti');

    this.start();
  }_createClass(Universe, [{ key: 'start', value: function start()

    {
      this.time.raf(this.tick.bind(this));
    } }, { key: 'tick', value: function tick(

    time) {
      this.time.update(time);

      if (this.time.hasFrames()) {
        this.update();
        this.time.processFrame();
      }

      this.render();
      this.time.raf(this.tick.bind(this));
    } }, { key: 'update', value: function update()

    {
      this.world.update(this.time.step);
    } }, { key: 'render', value: function render()

    {
      var gradient = this.ctx.createLinearGradient(0, 0, this.width, this.height);
     // gradient.addColorStop(0, '#34495e');
      //gradient.addColorStop(1, '#2c3e50');

      this.ctx.clearRect(0, 0, this.width, this.height);
      // this.ctx.fillStyle = '#2c3e50'
     // //this.ctx.fillStyle = gradient;
    // // this.ctx.fillRect(0, 0, this.width, this.height);
      this.world.render(this.ctx);
    }

    // Helpers 库
  }, { key: 'updateSize', value: function updateSize()
    {
      this.width = window.innerWidth;
      this.height = window.innerHeight;
      this.el.width = this.width * this.pixelRatio;
      this.el.height = this.height * this.pixelRatio;
      this.el.style.width = window.innerWidth + 'px';
      this.el.style.height = window.innerHeight + 'px';
      this.ctx.scale(this.pixelRatio, this.pixelRatio);
    } }, { key: 'addWorld', value: function addWorld(

    worldName, World) {
      this.worlds[worldName] = new World();
      this.worlds[worldName].universe = this;
      this.worlds[worldName].init();
    } }, { key: 'setWorld', value: function setWorld(

    worldName) {
      this.world = this.worlds[worldName];
    } }]);return Universe;}();



// Main

console.clear();
var element = document.querySelector('#canvas1');
window.Canvas= new Universe(element);</script>

<script>!function(o){var i=Array.prototype.slice.call(document.querySelectorAll("img[data-original]"));function c(t,e){var n=new Image,o=t.getAttribute("data-original");n.onload=function(){t.src=o,e&&e()},n.src=o}function n(){for(var t=0;t<i.length;t++)e=i[t],void 0,0<=(n=e.getBoundingClientRect()).top&&0<=n.left&&n.top<=(o.innerHeight||document.documentElement.clientHeight)&&c(i[t],function(){i.splice(t,t)});var e,n;console.log("trigger")}n(),o.addEventListener("scroll",function(){var t,e;t=n,e=o,clearTimeout(t.tId),t.tId=setTimeout(function(){t.call(e)},500)})}(this);</script></body>

    <style>
    *{
        margin: 0;
        padding: 0;
    }
    #canvas{
		 position: fixed;
         background: #ccc;
		 overflow: auto;
		 z-index: -1;
    }
    </style> 

	<canvas id="canvas"></canvas>
	
<link rel="stylesheet" href="/css/prism-tomorrow.css" type="text/css">
<body>
    
<script>!function(o){var i=Array.prototype.slice.call(document.querySelectorAll("img[data-original]"));function c(t,e){var n=new Image,o=t.getAttribute("data-original");n.onload=function(){t.src=o,e&&e()},n.src=o}function n(){for(var t=0;t<i.length;t++)e=i[t],void 0,0<=(n=e.getBoundingClientRect()).top&&0<=n.left&&n.top<=(o.innerHeight||document.documentElement.clientHeight)&&c(i[t],function(){i.splice(t,t)});var e,n;console.log("trigger")}n(),o.addEventListener("scroll",function(){var t,e;t=n,e=o,clearTimeout(t.tId),t.tId=setTimeout(function(){t.call(e)},500)})}(this);</script></body>
<script>
    window.requestAnimationFrame = (function(){
        return window.requestAnimationFrame ||
               window.webkitRequestAnimationFrame ||
               window.mozRequestAnimationFrame ||
               function( callback ){
                    window.setTimeout( callback, 1000/2 );
               };
    })();
    var myCanvas = document.getElementById("canvas");
    var ctx = myCanvas.getContext("2d");//getContext 设置画笔
    var num;
    var w,h;
    var duixiang = [];
    var move = {};
    function widthheight(){
        w = myCanvas.width = window.innerWidth;
        h = myCanvas.height = window.innerHeight;
		num= Math.floor(w*h*0.0001);
        for(var i = 0;i < num;i++){
            duixiang[i] = {
                x:Math.random()*w,
                y:Math.random()*h,
                cX:Math.random()*0.6-0.3,
                cY:Math.random()*0.6-0.3,
				R:Math.floor(Math.random()*5)+2,
				//CC:Math.floor(Math.random()*3)+2,
			    r: Math.floor(Math.random() * 254),   
                g: Math.floor(Math.random() * 254),  
                b:Math.floor(Math.random() * 254)   
            } 
           // console.log(duixiang[i])
            Cricle(duixiang[i].x,duixiang[i].y,duixiang[i].R,duixiang[i].r,duixiang[i].g,duixiang[i].b);
			 //Cricle(duixiang[i].x,duixiang[i].y,duixiang[i].R,duixiang[i].CC);
        }
    };widthheight();//获取浏览器的等宽度等高

    function Cricle(x,y,R,r,g,b){
        ctx.save();//保存路径
       if(Math.random()>0.991) {ctx.globalAlpha= 0.9;}//ctx.fillStyle = "#CCC";}//填充的背景颜色
	    else { ctx.globalAlpha=0.47;}
		 
		ctx.fillStyle = "rgb("+ r +","+ g +","+ b +")";
        ctx.beginPath();//开始绘画
		ctx.arc(x,y,R,Math.PI*2,0);//绘画圆 x y 半径（大小） 角度  一个PI 是180 * 2 = 360    真假 0/1 true/false
        ctx.closePath();//结束绘画
        ctx.fill();//填充背景颜色
        ctx.restore();//回复路径
    };Cricle();


    !function draw(){
        ctx.clearRect(0,0,w,h)//先清除画布上的点
        for(var i = 0;i < num;i++){
            duixiang[i].x += duixiang[i].cX;
            duixiang[i].y += duixiang[i].cY;
            if(duixiang[i].x>w || duixiang[i].x<0){
                duixiang[i].cX = -duixiang[i].cX;
            }
            if(duixiang[i].y>h || duixiang[i].y<0){
                duixiang[i].cY = -duixiang[i].cY;
            }
            Cricle(duixiang[i].x,duixiang[i].y,duixiang[i].R,duixiang[i].r,duixiang[i].g,duixiang[i].b);
            //勾股定理判断两点是否连线
            for(var j = i + 1;j < num;j++){
                if( (duixiang[i].x-duixiang[j].x)*(duixiang[i].x-duixiang[j].x)+(duixiang[i].y-duixiang[j].y)*(duixiang[i].y-duixiang[j].y) <= 55*55 ){
                    line(duixiang[i].x,duixiang[i].y,duixiang[j].x,duixiang[j].y,0,i,j)
                }
                if(move.x){
                    if( (duixiang[i].x-move.x)*(duixiang[i].x-move.x)+(duixiang[i].y-move.y)*(duixiang[i].y-move.y) <= 100*100 ){
                        line(duixiang[i].x,duixiang[i].y,move.x,move.y,1,i,1)
                    }
                }
            }
        }
        window.requestAnimationFrame(draw)
    }();

    //绘制线条
    function line(x1,y1,x2,y2,flag,i,j){
        
		if (flag){var color = ctx.createLinearGradient(x1,y1,x2,y2);
					ctx.globalAlpha=0.5;
					color.addColorStop(0,"rgb("+ duixiang[i].r +","+ duixiang[i].g +","+ duixiang[i].b +")");
					color.addColorStop(0.8,"#019ee5");
		        }
				else
				{
				
				var color = ctx.createLinearGradient(x1,y1,x2,y2);
					ctx.globalAlpha=0.9;
					color.addColorStop(0,"rgb("+ duixiang[i].r +","+ duixiang[i].g +","+ duixiang[i].b +")");
					color.addColorStop(1,"rgb("+ duixiang[j].r +","+ duixiang[j].g +","+ duixiang[j].b +")");
				}
        ctx.save();
        ctx.strokeStyle = color;
		ctx.lineWidth = 0.5;
        ctx.beginPath();
        ctx.moveTo(x1,y1);
        ctx.lineTo(x2,y2);
        ctx.stroke();
        //ctx.restore();
    }


    //document.onmousemove = function(e){
     //   move.x = e.clientX;
      //  move.y = e.clientY;
    //}
    //console.log(move)

    window.onresize = function(){
        location.reload();
    }
</script>














<div class="bg-cover pd-header post-cover" style="background-image: url('/medias/featureimages/8.jpg')">
    <div class="container">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <div class="description center-align post-title">
                        搭桥
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>



<main class="container content">

    
    <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/tags/ACM/" target="_blank">
                                <span class="chip bg-color">ACM</span>
                            </a>
                        
                            <a href="/tags/搜索/" target="_blank">
                                <span class="chip bg-color">搜索</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                </div>
            </div>

            <div class="post-info">
                <div class="post-date info-break-policy">
                    <i class="fa fa-calendar-minus-o fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2018-09-29
                </div>

                
                    
                    <div class="info-break-policy">
                        <i class="fa fa-file-word-o fa-fw"></i>文章字数:&nbsp;&nbsp;
                        1.6k
                    </div>
                    

                    
                    <div class="info-break-policy">
                        <i class="fa fa-clock-o fa-fw"></i>阅读时长:&nbsp;&nbsp;
                        6 分
                    </div>
                    
                
				
				
                    <div id="busuanzi_container_page_pv" class="info-break-policy">
                        <i class="fa fa-eye fa-fw"></i>阅读次数:&nbsp;&nbsp;
                        <span id="busuanzi_value_page_pv"></span>
                    </div>
				
            </div>
        </div>
        <hr class="clearfix">
        <div class="card-content article-card-content">
            <div id="articleContent">
                <p>题目：搭桥<br>题目链接：<a href="http://codevs.cn/problem/1002/" target="_blank" rel="noopener">http://codevs.cn/problem/1002/</a><br>题目描述 Description<br>有一矩形区域的城市中建筑了若干建筑物，如果某两个单元格有一个点相联系，则它们属于同一座建筑物。现在想在这些建筑物之间搭建一些桥梁，其中桥梁只能沿着矩形的方格的边沿搭建，如下图城市1有5栋建筑物，可以搭建4座桥将建筑物联系起来。城市2有两座建筑物，但不能搭建桥梁将它们连接。城市3只有一座建筑物，城市4有3座建筑物，可以搭建一座桥梁联系两栋建筑物，但不能与第三座建筑物联系在一起。</p>
<p>输入描述 Input Description<br>在输入的数据中的第一行包含描述城市的两个整数r 和c, 分别代表从北到南、从东到西的城市大小(1 &lt;= r &lt;= 50 and 1 &lt;=  c &lt;= 50). 接下来的r 行, 每一行由c 个(“#”)和(“.”)组成的字符. 每一个字符表示一个单元格。“#”表示建筑物，“.”表示空地。</p>
<p>输出描述 Output Description<br>在输出的数据中有两行，第一行表示建筑物的数目。第二行输出桥的数目和所有桥的总长度。<br>样例输入 Sample Input<br>样例1<br>3 5</p>
<p>#…#<br>..#..</p>
<p>#…#</p>
<p>样例2<br>3 5</p>
<p>##…<br>…..<br>….#</p>
<p>样例3<br>3 5</p>
<p>#.###</p>
<p>#.#.#</p>
<p>###.#</p>
<p>样例4:<br>3 5</p>
<p>#.#..<br>…..<br>….#</p>
<p>样例输出 Sample Output<br>样例1<br>5<br>4 4</p>
<p>样例2<br>2<br>0 0</p>
<p>样例3<br>1<br>0 0</p>
<p>样例4<br>3<br>1 1<br>                                      题解</p>
<p>题意概括： 一，先找到该城市有多少楼，即矩阵（城市）中有多少联通块（楼）。<br>           二，通过桥将该城市的楼互通，即每两两楼之间可间接或直接到达。</p>
<p>解题思路： 针对 一， 遍历输入矩阵，遇到不是空地（即是楼的部分），则进入该楼区域，用DFS搜联通块（该楼的全部区域）并过程中给每个楼编号。<br>           针对 二，遍历输入矩阵，遇到满足可以架桥的楼的部分，开始横向或纵向架桥，<br>           遇到其它楼（不是空地且不是同一栋楼），则保存该可行桥信息并结束此次架桥。<br>           找到所有可行桥。按桥长从小到大给所有可行桥排序。然后按从小到大，用并查集来获取最少桥数与最短桥总长。</p>
<pre><code>    寻可行桥图解
</code></pre><p>一，    图1中 红线边代表可以作为架桥的桥头，绿线代表作为架桥的桥尾。<br> 2 与 3 满足架桥桥头条件，遍历到2和3处 可以进行架可行桥。</p>
<pre><code>             图1
</code></pre><p>二，以 2为例  若横向架长为1的桥 则桥尾可落在 A,B,C 框中，而A,B,C均为空地则增加桥长，直到找到一个可以作为桥尾的边 如图3 找到了C区域，记录桥信息并结束本次架桥，开始纵向架桥，完成后，遍历到 3的位子继续架桥，知道遍历完所有</p>
<p>   图2                                          图3</p>
<pre class=" language-c"><code class="language-c"><span class="token macro property">#<span class="token directive keyword">include</span> <span class="token string">&lt;stdio.h></span></span>
<span class="token macro property">#<span class="token directive keyword">include</span> <span class="token string">&lt;string.h></span></span>
<span class="token macro property">#<span class="token directive keyword">define</span> N 55</span>
<span class="token macro property">#<span class="token directive keyword">define</span> Min(a,b)  a>b?b:a</span>
<span class="token keyword">struct</span> node<span class="token punctuation">{</span><span class="token keyword">int</span> q1<span class="token punctuation">,</span>q2<span class="token punctuation">,</span>qw<span class="token punctuation">;</span><span class="token punctuation">}</span>Q<span class="token punctuation">[</span>N<span class="token operator">*</span>N<span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">//存储桥的信息 桥头 桥尾 桥长</span>
<span class="token keyword">int</span> n<span class="token punctuation">,</span>c<span class="token punctuation">;</span>
<span class="token keyword">int</span> Map<span class="token punctuation">[</span>N<span class="token punctuation">]</span><span class="token punctuation">[</span>N<span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">//输入矩阵</span>
<span class="token keyword">int</span> dx<span class="token punctuation">[</span><span class="token number">8</span><span class="token punctuation">]</span><span class="token operator">=</span><span class="token punctuation">{</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">//8个方位</span>
<span class="token keyword">int</span> dy<span class="token punctuation">[</span><span class="token number">8</span><span class="token punctuation">]</span><span class="token operator">=</span><span class="token punctuation">{</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token keyword">int</span> q_ans<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">//所有可行桥数</span>
<span class="token keyword">int</span> F<span class="token punctuation">[</span>N<span class="token operator">*</span>N<span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">//用于并查集头数组</span>
<span class="token keyword">int</span> Q_C<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">//桥总长</span>
<span class="token keyword">int</span> ans<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">//桥总长</span>
<span class="token comment" spellcheck="true">//并查集寻头节点（递归版）</span>
<span class="token keyword">int</span> <span class="token function">find1</span><span class="token punctuation">(</span><span class="token keyword">int</span> a<span class="token punctuation">)</span><span class="token punctuation">{</span><span class="token keyword">if</span><span class="token punctuation">(</span>F<span class="token punctuation">[</span>a<span class="token punctuation">]</span><span class="token operator">!=</span>a<span class="token punctuation">)</span><span class="token keyword">return</span> a<span class="token punctuation">;</span><span class="token keyword">else</span> <span class="token keyword">return</span> F<span class="token punctuation">[</span>a<span class="token punctuation">]</span><span class="token operator">=</span><span class="token function">find1</span><span class="token punctuation">(</span>F<span class="token punctuation">[</span>a<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token punctuation">}</span>
<span class="token comment" spellcheck="true">//深搜获得楼房数 以及给楼房编号</span>
<span class="token keyword">void</span> <span class="token function">DFS</span><span class="token punctuation">(</span><span class="token keyword">int</span> x<span class="token punctuation">,</span><span class="token keyword">int</span> y<span class="token punctuation">,</span><span class="token keyword">int</span> num<span class="token punctuation">)</span>
<span class="token punctuation">{</span>   <span class="token keyword">int</span> xx<span class="token punctuation">,</span>yy<span class="token punctuation">,</span>k<span class="token punctuation">;</span>Map<span class="token punctuation">[</span>x<span class="token punctuation">]</span><span class="token punctuation">[</span>y<span class="token punctuation">]</span><span class="token operator">=</span>num<span class="token punctuation">;</span><span class="token comment" spellcheck="true">//给楼编号</span>
    <span class="token keyword">for</span><span class="token punctuation">(</span>k<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span>k<span class="token operator">&lt;</span><span class="token number">8</span><span class="token punctuation">;</span>k<span class="token operator">++</span><span class="token punctuation">)</span>
    <span class="token punctuation">{</span>  xx<span class="token operator">=</span>x<span class="token operator">+</span>dx<span class="token punctuation">[</span>k<span class="token punctuation">]</span><span class="token punctuation">;</span>yy<span class="token operator">=</span>y<span class="token operator">+</span>dy<span class="token punctuation">[</span>k<span class="token punctuation">]</span><span class="token punctuation">;</span>
     <span class="token keyword">if</span><span class="token punctuation">(</span>Map<span class="token punctuation">[</span>xx<span class="token punctuation">]</span><span class="token punctuation">[</span>yy<span class="token punctuation">]</span><span class="token operator">==</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token function">DFS</span><span class="token punctuation">(</span>xx<span class="token punctuation">,</span>yy<span class="token punctuation">,</span>num<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<span class="token comment" spellcheck="true">//检查函数 判断两点是否可建桥</span>
<span class="token keyword">int</span> <span class="token function">check</span><span class="token punctuation">(</span><span class="token keyword">int</span> x<span class="token punctuation">,</span><span class="token keyword">int</span> y<span class="token punctuation">,</span><span class="token keyword">int</span> x1<span class="token punctuation">,</span><span class="token keyword">int</span> y1<span class="token punctuation">,</span><span class="token keyword">int</span> flag<span class="token punctuation">)</span>
<span class="token punctuation">{</span>    <span class="token comment" spellcheck="true">//无建筑 或为同一建筑直接返回</span>
    <span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span>Map<span class="token punctuation">[</span>x1<span class="token punctuation">]</span><span class="token punctuation">[</span>y1<span class="token punctuation">]</span><span class="token operator">||</span>Map<span class="token punctuation">[</span>x<span class="token punctuation">]</span><span class="token punctuation">[</span>y<span class="token punctuation">]</span><span class="token operator">==</span>Map<span class="token punctuation">[</span>x1<span class="token punctuation">]</span><span class="token punctuation">[</span>y1<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token keyword">return</span> <span class="token number">0</span><span class="token punctuation">;</span>
  q_ans<span class="token operator">++</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">//可行桥数+1</span>
     <span class="token keyword">if</span><span class="token punctuation">(</span>flag<span class="token operator">==</span><span class="token number">1</span><span class="token punctuation">)</span>Q<span class="token punctuation">[</span>q_ans<span class="token punctuation">]</span><span class="token punctuation">.</span>q1<span class="token operator">=</span>Map<span class="token punctuation">[</span>x<span class="token punctuation">]</span><span class="token punctuation">[</span>y<span class="token punctuation">]</span><span class="token punctuation">,</span>Q<span class="token punctuation">[</span>q_ans<span class="token punctuation">]</span><span class="token punctuation">.</span>q2<span class="token operator">=</span>Map<span class="token punctuation">[</span>x1<span class="token punctuation">]</span><span class="token punctuation">[</span>y1<span class="token punctuation">]</span><span class="token punctuation">,</span>Q<span class="token punctuation">[</span>q_ans<span class="token punctuation">]</span><span class="token punctuation">.</span>qw<span class="token operator">=</span>y1<span class="token operator">-</span>y<span class="token number">-1</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">//当建桥方向为横向（向右）存储桥信息</span>
     <span class="token keyword">else</span> Q<span class="token punctuation">[</span>q_ans<span class="token punctuation">]</span><span class="token punctuation">.</span>q1<span class="token operator">=</span>Map<span class="token punctuation">[</span>x<span class="token punctuation">]</span><span class="token punctuation">[</span>y<span class="token punctuation">]</span><span class="token punctuation">,</span>Q<span class="token punctuation">[</span>q_ans<span class="token punctuation">]</span><span class="token punctuation">.</span>q2<span class="token operator">=</span>Map<span class="token punctuation">[</span>x1<span class="token punctuation">]</span><span class="token punctuation">[</span>y1<span class="token punctuation">]</span><span class="token punctuation">,</span>Q<span class="token punctuation">[</span>q_ans<span class="token punctuation">]</span><span class="token punctuation">.</span>qw<span class="token operator">=</span>x1<span class="token operator">-</span>x<span class="token number">-1</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">//当建桥方向为纵向（向下）存储桥信息</span>
     <span class="token keyword">return</span> <span class="token number">1</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token comment" spellcheck="true">//找桥尾楼</span>
<span class="token keyword">void</span> <span class="token function">FQ_end</span><span class="token punctuation">(</span><span class="token keyword">int</span> x<span class="token punctuation">,</span><span class="token keyword">int</span> y<span class="token punctuation">,</span><span class="token keyword">int</span> flag<span class="token punctuation">)</span>
<span class="token punctuation">{</span>  <span class="token keyword">int</span> k<span class="token punctuation">;</span>
    <span class="token keyword">if</span><span class="token punctuation">(</span>flag<span class="token operator">==</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">{</span><span class="token comment" spellcheck="true">//横向（向右）方向</span>
         <span class="token keyword">for</span> <span class="token punctuation">(</span>k<span class="token operator">=</span>y<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">;</span>k<span class="token operator">&lt;=</span>c<span class="token punctuation">;</span>k<span class="token operator">++</span><span class="token punctuation">)</span>
         <span class="token keyword">if</span><span class="token punctuation">(</span><span class="token function">check</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span>y<span class="token punctuation">,</span>x<span class="token punctuation">,</span>k<span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token operator">||</span><span class="token function">check</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span>y<span class="token punctuation">,</span>x<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">,</span>k<span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token operator">||</span><span class="token function">check</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span>y<span class="token punctuation">,</span>x<span class="token number">-1</span><span class="token punctuation">,</span>k<span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token keyword">break</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token keyword">else</span><span class="token punctuation">{</span><span class="token comment" spellcheck="true">//纵向（向下）方向</span>
         <span class="token keyword">for</span> <span class="token punctuation">(</span>k<span class="token operator">=</span>x<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">;</span>k<span class="token operator">&lt;=</span>n<span class="token punctuation">;</span>k<span class="token operator">++</span><span class="token punctuation">)</span>
         <span class="token keyword">if</span><span class="token punctuation">(</span><span class="token function">check</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span>y<span class="token punctuation">,</span>k<span class="token punctuation">,</span>y<span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token operator">||</span><span class="token function">check</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span>y<span class="token punctuation">,</span>k<span class="token punctuation">,</span>y<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token operator">||</span><span class="token function">check</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span>y<span class="token punctuation">,</span>k<span class="token punctuation">,</span>y<span class="token number">-1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token keyword">break</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<span class="token comment" spellcheck="true">//建立可行桥</span>
<span class="token keyword">void</span> <span class="token function">BulidQ</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>  <span class="token keyword">int</span> i<span class="token punctuation">,</span>j<span class="token punctuation">;</span>
      <span class="token keyword">for</span><span class="token punctuation">(</span>i<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">;</span>i<span class="token operator">&lt;=</span>n<span class="token punctuation">;</span>i<span class="token operator">++</span><span class="token punctuation">)</span>
        <span class="token keyword">for</span><span class="token punctuation">(</span>j<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">;</span>j<span class="token operator">&lt;=</span>c<span class="token punctuation">;</span>j<span class="token operator">++</span><span class="token punctuation">)</span>
         <span class="token punctuation">{</span>
            <span class="token keyword">if</span><span class="token punctuation">(</span>Map<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token operator">==</span><span class="token number">0</span><span class="token operator">&amp;&amp;</span>Map<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">!=</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">{</span> <span class="token function">FQ_end</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span>j<span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token punctuation">}</span>  <span class="token comment" spellcheck="true">//满足横向（右方）向架桥</span>
            <span class="token keyword">if</span><span class="token punctuation">(</span>Map<span class="token punctuation">[</span>i<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">==</span><span class="token number">0</span><span class="token operator">&amp;&amp;</span>Map<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">!=</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">{</span> <span class="token function">FQ_end</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span>j<span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token punctuation">}</span>  <span class="token comment" spellcheck="true">//满足纵向（下方）向架桥</span>
         <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<span class="token comment" spellcheck="true">//并查集 寻最少桥数与最短桥总长</span>
<span class="token keyword">int</span>  <span class="token function">BCJ</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
  <span class="token keyword">int</span> i<span class="token punctuation">,</span>top1<span class="token punctuation">,</span>top2<span class="token punctuation">,</span>count1<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span>
 <span class="token keyword">for</span><span class="token punctuation">(</span>i<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">;</span>i<span class="token operator">&lt;=</span>ans<span class="token punctuation">;</span>i<span class="token operator">++</span><span class="token punctuation">)</span>F<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token operator">=</span>i<span class="token punctuation">;</span><span class="token comment" spellcheck="true">//初始化</span>
 <span class="token keyword">for</span><span class="token punctuation">(</span>i<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">;</span>i<span class="token operator">&lt;=</span>q_ans<span class="token punctuation">;</span>i<span class="token operator">++</span><span class="token punctuation">)</span><span class="token comment" spellcheck="true">//从小到达遍历可行桥</span>
 <span class="token punctuation">{</span>
      top1<span class="token operator">=</span><span class="token function">find1</span><span class="token punctuation">(</span>Q<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>q1<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">//找到该桥头楼的主楼（头节点）</span>
      top2<span class="token operator">=</span><span class="token function">find1</span><span class="token punctuation">(</span>Q<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>q2<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">//找到该桥尾楼的主楼（头节点）</span>
      <span class="token keyword">if</span><span class="token punctuation">(</span>top1<span class="token operator">!=</span>top2<span class="token punctuation">)</span><span class="token punctuation">{</span><span class="token comment" spellcheck="true">//若两主楼不是同一楼，则通过该桥建立连接共用主楼</span>
          F<span class="token punctuation">[</span>top1<span class="token punctuation">]</span><span class="token operator">=</span>top2<span class="token punctuation">;</span>
          count1<span class="token operator">++</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">//桥数+1</span>
          Q_C<span class="token operator">+</span><span class="token operator">=</span>Q<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>qw<span class="token punctuation">;</span><span class="token comment" spellcheck="true">//更新桥总长 桥总长+该桥长度</span>
      <span class="token punctuation">}</span>
 <span class="token punctuation">}</span>
  <span class="token keyword">return</span> count1<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token keyword">int</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>  <span class="token keyword">int</span> i<span class="token punctuation">,</span>j<span class="token punctuation">;</span><span class="token keyword">char</span> z<span class="token punctuation">;</span><span class="token keyword">int</span> num<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">;</span>
    <span class="token function">memset</span><span class="token punctuation">(</span>Map<span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token keyword">sizeof</span><span class="token punctuation">(</span>Map<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
     <span class="token function">memset</span><span class="token punctuation">(</span>F<span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token keyword">sizeof</span><span class="token punctuation">(</span>F<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token function">scanf</span><span class="token punctuation">(</span><span class="token string">"%d%d"</span><span class="token punctuation">,</span><span class="token operator">&amp;</span>n<span class="token punctuation">,</span><span class="token operator">&amp;</span>c<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">for</span> <span class="token punctuation">(</span>i<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">;</span>i<span class="token operator">&lt;=</span>n<span class="token punctuation">;</span>i<span class="token operator">++</span><span class="token punctuation">)</span>
    <span class="token keyword">for</span> <span class="token punctuation">(</span>j<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">;</span>j<span class="token operator">&lt;=</span>c<span class="token punctuation">;</span>j<span class="token operator">++</span><span class="token punctuation">)</span>
        <span class="token keyword">while</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token comment" spellcheck="true">//处理字符串</span>
        <span class="token punctuation">{</span>
            <span class="token function">scanf</span><span class="token punctuation">(</span><span class="token string">"%c"</span><span class="token punctuation">,</span><span class="token operator">&amp;</span>z<span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token keyword">if</span><span class="token punctuation">(</span>z<span class="token operator">==</span><span class="token string">'#'</span><span class="token punctuation">)</span><span class="token punctuation">{</span>Map<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">=</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">;</span><span class="token keyword">break</span><span class="token punctuation">;</span><span class="token punctuation">}</span>
            <span class="token keyword">if</span><span class="token punctuation">(</span>z<span class="token operator">==</span><span class="token string">'.'</span><span class="token punctuation">)</span><span class="token punctuation">{</span>Map<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span><span class="token keyword">break</span><span class="token punctuation">;</span><span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
   <span class="token comment" spellcheck="true">//获得楼房数 以及给楼房编号</span>
    <span class="token keyword">for</span> <span class="token punctuation">(</span>i<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">;</span>i<span class="token operator">&lt;=</span>n<span class="token punctuation">;</span>i<span class="token operator">++</span><span class="token punctuation">)</span>
    <span class="token keyword">for</span> <span class="token punctuation">(</span>j<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">;</span>j<span class="token operator">&lt;=</span>c<span class="token punctuation">;</span>j<span class="token operator">++</span><span class="token punctuation">)</span>
    <span class="token keyword">if</span><span class="token punctuation">(</span>Map<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">==</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token function">DFS</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span>j<span class="token punctuation">,</span>num<span class="token punctuation">)</span><span class="token punctuation">,</span>ans<span class="token operator">++</span><span class="token punctuation">,</span>num<span class="token operator">++</span><span class="token punctuation">;</span>
    <span class="token function">BulidQ</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token comment" spellcheck="true">//给桥长排序从小到大（选择排序）</span>
    <span class="token keyword">for</span><span class="token punctuation">(</span>i<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">;</span>i<span class="token operator">&lt;</span>q_ans<span class="token punctuation">;</span>i<span class="token operator">++</span><span class="token punctuation">)</span>
    <span class="token keyword">for</span><span class="token punctuation">(</span>j<span class="token operator">=</span>i<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">;</span>j<span class="token operator">&lt;=</span>q_ans<span class="token punctuation">;</span>j<span class="token operator">++</span><span class="token punctuation">)</span>
    <span class="token keyword">if</span><span class="token punctuation">(</span>Q<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>qw<span class="token operator">></span>Q<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">.</span>qw<span class="token punctuation">)</span><span class="token punctuation">{</span>node tem<span class="token operator">=</span>Q<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">;</span>Q<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token operator">=</span>Q<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">;</span> Q<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">=</span>tem<span class="token punctuation">;</span><span class="token punctuation">}</span>
   <span class="token keyword">int</span> res<span class="token operator">=</span><span class="token function">BCJ</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token function">printf</span><span class="token punctuation">(</span><span class="token string">"%d\n%d %d\n"</span><span class="token punctuation">,</span>ans<span class="token punctuation">,</span>res<span class="token punctuation">,</span>Q_C<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">return</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>

<span class="token comment" spellcheck="true">/*


5 5
##...
...##
###..
..###
...##

3 5
#...#
..#..
#...#
5 5
##...
....#
#...#
##...
..###

 */</span>

</code></pre>

            </div>
            <hr>

            
            <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.88rem;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-large waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fa fa-close"></i></a>
            <h4 class="reward-title">博主不易，靠赏过日！！！</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="/medias/logo-loading1.png" data-original="/medias/reward/alipay.jpg" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="/medias/logo-loading1.png" data-original="/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>
            

            <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">

<div id="article-share">
    
    <div class="social-share" data-disabled="qzone" data-wechat-qrcode-helper="<p>微信里点“发现”->“扫一扫”二维码便可查看分享。</p>"></div>
    
</div>

<script src="/libs/share/js/social-share.min.js"></script>

            <div class="reprint">
                <p>
                    <span class="reprint-tip">
                        <i class="fa fa-exclamation-circle"></i>&nbsp;&nbsp;转载请注明:
                    </span>
                    <a href="https://five-great.coding.me" class="b-link-green">Five-great的博客</a>
                    <i class="fa fa-angle-right fa-lg fa-fw text-color"></i>
                    <a href="/da-qiao.html" class="b-link-green">搭桥</a>
                </p>
            </div>
        </div>
    </div>

    

    

    

    
    <div class="livere-card card" data-aos="fade-up">
    <!-- 来必力City版安装代码 -->
    <div id="lv-container" class="card-content" data-id="city" data-uid="MTAyMC80MDE5NS8xNjcyMg==">
        <script type="text/javascript">
            (function (d, s) {
                let j, e = d.getElementsByTagName(s)[0];
                if (typeof LivereTower === 'function') {
                    return;
                }

                j = d.createElement(s);
                j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
                j.async = true;

                e.parentNode.insertBefore(j, e);
            })(document, 'script');
        </script>
        <noscript>为正常使用来必力评论功能请激活JavaScript。</noscript>
    </div>
    <!-- City版安装代码已完成 -->
</div>
    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fa fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/friend-fei-bo-na-qi.html">
                    <div class="card-image">
                        
                        
                        <img src="/medias/logo-loading1.png" data-original="/medias/featureimages/15.jpg" class="responsive-img" alt="friend-斐波那契">
                        
                        <span class="card-title">friend-斐波那契</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary">friend-斐波那契html {overflow-x: initial !important;}:root { –bg-color:#ffffff; –text-color:#333333; –select-text-bg-color:#</div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="fa fa-clock-o fa-fw icon-date"></i>2018-10-04
                        </span>
                        <span class="publish-author">
                            
                            <i class="fa fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/程序设计/" class="post-category" target="_blank">
                                    程序设计
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/ACM/" target="_blank">
                        <span class="chip bg-color">ACM</span>
                    </a>
                    
                    <a href="/tags/水题/" target="_blank">
                        <span class="chip bg-color">水题</span>
                    </a>
                    
                    <a href="/tags/快速幂/" target="_blank">
                        <span class="chip bg-color">快速幂</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fa fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/acm.html">
                    <div class="card-image">
                        
                        
                        <img src="/medias/logo-loading1.png" data-original="/medias/featureimages/11.jpg" class="responsive-img" alt="ACM">
                        
                        <span class="card-title">ACM</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary">#你好这是我第一篇文章:)题目描述 Description
汉诺塔问题（又称为河内塔问题），是一个大家熟知的问题。在A，B，C三根柱子上，
有n个不同大小的圆盘（假设半径分别为1-n吧），一开始他们都叠在我A上（如图所示），
你的目标是在最</div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="fa fa-clock-o fa-fw icon-date"></i>2018-09-28
                            </span>
                        <span class="publish-author">
                            
                            <i class="fa fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/前端/" class="post-category" target="_blank">
                                    前端
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
            </div>
        </div>
        
    </div>
</article>
</div>


    

</main>






<script type="text/javascript">
$(document).ready(function(){
  if(window.outerHeight <500&&window.outerWidth<400){
  $("#p1").hide();
 
   }else{
  $("#p1").show();
  
  }
});
</script>


<footer class="page-footer bg-color">
 
 
 
 
 <div>
 
 
 <li class="col s12 m8 l8 copy-right">
  友链：
         
            
                
                
				
             <a href="https://blog.csdn.net/qq_41923622" target="_blank">
                         &nbsp;&nbsp;<i class="fa fa-link fa-lg"></i> Five-菜鸟级
               </a>
                
                
				
             <a href="https://blinkfox.github.io/" target="_blank">
                         &nbsp;&nbsp;<i class="fa fa-link fa-lg"></i> 闪烁之狐
               </a>
                
                
				
             <a href="https://zwxzwx.vip" target="_blank">
                         &nbsp;&nbsp;<i class="fa fa-link fa-lg"></i> 时光之轴
               </a>
                
                
				
             <a href="https://shenah.cn" target="_blank">
                         &nbsp;&nbsp;<i class="fa fa-link fa-lg"></i> 迷一样的自信
               </a>
                
                
				
             <a href="https://feng1632009.github.io/" target="_blank">
                         &nbsp;&nbsp;<i class="fa fa-link fa-lg"></i> 空灵的Blog
               </a>
                
            

 
 
	   		  
		<span id="busuanzi_container_site_uv" style="float:right"> 
  恭喜您成为第 <span id="busuanzi_value_site_uv" class="white-color"></span>位访客&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  
      </span>
      
	  </li>
   </div>
   
	   <div class="container row center-align">
		<div class="col s12 m8 l8 copy-right">
            
         <span id="p1">&nbsp;&nbsp;&nbsp;</span>
            
			
                
                
                <span id="busuanzi_container_site_pv">
                       <i class="fa fa-heart-o"></i>
                    本站总访问量 <span id="busuanzi_value_site_pv" class="white-color"></span>
                </span>
                
                
                <span id="busuanzi_container_site_uv">
                    <i class="fa fa-users"></i>
                    次&nbsp;
                </span>
                
              
			
			
                <i class="fa fa-area-chart"></i>站点总字数:
                <span class="white-color">21.7k</span>
            <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			本站由&copy;<a href="https://github.com/Five-great/Five-great.github.io" target="_blank">LHL</a>基于
            <a href="https://hexo.io/" target="_blank">Hexo</a> 搭建.
			
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/Five-great/" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fa fa-github"></i>
    </a>



    <a href="mailto:985540932@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fa fa-envelope-open"></i>
    </a>



    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=985540932" class="tooltipped" data-tooltip="QQ联系我: 985540932" data-position="top" data-delay="50">
        <i class="fa fa-qq"></i>
    </a>



    <a href="/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fa fa-rss"></i>
    </a>


</div>
    </div>
</footer>

<div class="progress-bar"></div>


<!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fa fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字" class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script src="/js/search.js"></script>
<script type="text/javascript">
$(function () {
    searchFunc("/" + "search.xml", 'searchInput', 'searchResult');
});
</script>
<!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fa fa-angle-up"></i>
    </a>
</div>


<script src="/libs/materialize/materialize.min.js"></script>
<script src="/libs/masonry/masonry.pkgd.min.js"></script>
<script src="/libs/aos/aos.js"></script>
<script src="/libs/scrollprogress/scrollProgress.min.js"></script>
<script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>
<script src="/js/matery.js"></script>

<!-- Global site tag (gtag.js) - Google Analytics -->



    <script src="/libs/others/clicklove.js"></script>


    <script async src="/libs/others/busuanzi.pure.mini.js"></script>


<script>!function(o){var i=Array.prototype.slice.call(document.querySelectorAll("img[data-original]"));function c(t,e){var n=new Image,o=t.getAttribute("data-original");n.onload=function(){t.src=o,e&&e()},n.src=o}function n(){for(var t=0;t<i.length;t++)e=i[t],void 0,0<=(n=e.getBoundingClientRect()).top&&0<=n.left&&n.top<=(o.innerHeight||document.documentElement.clientHeight)&&c(i[t],function(){i.splice(t,t)});var e,n;console.log("trigger")}n(),o.addEventListener("scroll",function(){var t,e;t=n,e=o,clearTimeout(t.tId),t.tId=setTimeout(function(){t.call(e)},500)})}(this);</script></body>
<script>
$("#loading").fadeOut(5000);
</script>
</html>